package com.itheima.service;

import com.github.pagehelper.Page;
import com.itheima.domain.Book;
import com.itheima.domain.User;
import entity.PageResult;

public interface BookService {
    PageResult selectNewBooks(Integer pageNum,Integer pageSize);
    Book findById(String id);

    /**
     * @param book
     * @return
     */
    Integer borrowBook(Book book);
    //分页查询图书
    PageResult search(Book book,Integer pageNum, Integer pageSize);
    //新增图书
    Integer addBook(Book book);
    //编辑信息
    Integer editBook(Book book);

    PageResult searchBorrowed(Book book, User user,Integer pageNum,Integer pageSize);

    boolean returnBook(String id,User user);

    Integer returnConfirm(String id);
}
